// File generated from our OpenAPI spec by Stainless.

package com.metest.api.models.rest.actuator.loggers

import kotlin.jvm.optionals.getOrNull
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class LoggerUpdateParamsTest {

    @Test
    fun create() {
        LoggerUpdateParams.builder().name("name").body(LoggerUpdateParams.Body.TRACE).build()
    }

    @Test
    fun pathParams() {
        val params = LoggerUpdateParams.builder().name("name").build()

        assertThat(params._pathParam(0)).isEqualTo("name")
        // out-of-bound path param
        assertThat(params._pathParam(1)).isEqualTo("")
    }

    @Test
    fun body() {
        val params =
            LoggerUpdateParams.builder().name("name").body(LoggerUpdateParams.Body.TRACE).build()

        val body = params._body().getOrNull()

        assertThat(body).isEqualTo(LoggerUpdateParams.Body.TRACE)
    }

    @Test
    fun bodyWithoutOptionalFields() {
        val params = LoggerUpdateParams.builder().name("name").build()

        val body = params._body().getOrNull()
    }
}
